﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Ninject;

namespace QuickApp.Core
{
    public class NinjectDependencyResolver : IDependencyResolver
    {
        IKernel Kernel;
        public NinjectDependencyResolver(IKernel kernel)
        {
            this.Kernel = kernel;
        }
        public object GetService(Type serviceType)
        {
            return Kernel.TryGet(serviceType);
        }

        public IEnumerable<object> GetServices(Type serviceType)
        {
            return Kernel.GetAll(serviceType);
        }
    }
}
